package com.lagou.service.impl;

import cn.hutool.extra.mail.MailUtil;
import com.lagou.service.IEmailService;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.stereotype.Component;

@Service
@Component
@RefreshScope
public class EmailServiceImpl implements IEmailService {


    @Override
    public boolean sendEmail(String mailTo,  String message) {
        try {
            MailUtil.send(mailTo, "邮箱验证码", message, false);
            return true;
        } catch (Exception ex) {
            ex.printStackTrace();
            return false;
        } finally {
        }
    }
}
